/**
 * 
 */
package sn.ugb.cours.zd.ejb.entity;

import static sn.ugb.cours.zd.ejb.entity.Etudiant.QN.ALL_ETUDIANT;
import static sn.ugb.cours.zd.ejb.entity.Etudiant.QN.FIND_ETUDIANT;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 * @author zakaria
 * 
 */
@Entity
@NamedQueries({
		@NamedQuery(name = ALL_ETUDIANT, query = "select o FROM Etudiant o"),
		@NamedQuery(name = FIND_ETUDIANT, query = "select o FROM Etudiant o WHERE o.nom = :NAME") })
public class Etudiant extends Personne {

	private static final long serialVersionUID = 1657522584199438875L;

	public static interface QN {
		String ALL_ETUDIANT = "etudiant.allEtudiants";
		String FIND_ETUDIANT = "etudiant.findEtudiant";
	}

	@Enumerated(EnumType.STRING)
	private TypeFormation typeFormation = TypeFormation.INCONNUE;

	public Etudiant() {
		setTypeFormation(TypeFormation.INITIALE);
	}

	public TypeFormation getTypeFormation() {
		return typeFormation;
	}

	public void setTypeFormation(TypeFormation typeFormation) {
		this.typeFormation = typeFormation;
	}

	/**
	 * constructeur avec variables d'instance
	 * 
	 * @param nom
	 * @param prenom
	 * @param mail
	 * @param typeFormation
	 */
	public Etudiant(String nom, String prenom, String mail,
			TypeFormation typeFormation) {
		super(nom, prenom, mail);
		setTypeFormation(typeFormation);
	}

	public Etudiant(String nom, String prenom, String mail) {
		super(nom, prenom, mail);
	}

}
